package com.skcc.cip.ngms.auth.processor;


import org.apache.camel.Exchange;
import org.apache.camel.processor.aggregate.AggregationStrategy;


public class UserInfoAggregator implements AggregationStrategy{
    
    public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
//	MemberSearchResult result=null;
//	try {
//	    result = (MemberSearchResult)(ExchangeHelper.getMandatoryInBody(newExchange, java.util.List.class)).get(0);
//	} catch (InvalidPayloadException e) {
//	    // TODO Auto-generated catch block
//	    e.printStackTrace();
//	}
//	
//	    HttpServletRequest request = oldExchange.getIn().getBody(HttpServletRequest.class);
//	    request.getSession().setAttribute("companyCD", result.getCompanyCd());
//	    request.getSession().setAttribute("deptCode", result.getDeptCode());
//	    oldExchange.getIn().setHeader("companyCD", result.getCompanyCd());
//	    oldExchange.getIn().setHeader("deptCode", result.getDeptCode());
//	    oldExchange.getIn().setBody(request);  
//	//    System.out.println("oldExchange ******************************************************************************"+oldExchange);
//	//    System.out.println("newExchange ******************************************************************************"+newExchange);
	return oldExchange;
    }
    
}
